#!/usr/bin/env bash

[[ "$TRACE" ]] && set -x
pushd `dirname "$0"` > /dev/null
trap `popd > /dev/null` EXIT

NEWPATH=`../privatePath.sh`
[[ $? -ne 0 ]] && exit 1
PATH="$NEWPATH"

rm -rf kds
mkdir -p kds

kds --tpl_path=tpls --out=kds *.kds
[[ $? -ne 0 ]] && exit 1

rm -rf pb
mkdir -p pb

cp test.proto kds/

protoc -I=./kds -I=../local/protoc/include \
	--go_out=paths=source_relative:./pb \
	`find kds -name "*.proto"`